package com.elf.zero.form;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;

public class FormTextEdit extends FormTextView {

    public FormTextEdit(Context context) {
        super(context);
    }

    public FormTextEdit(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.zero_form_text_edit;
    }

    @Override
    protected void initView(AttributeSet attrs) {
        super.initView(attrs);
        if (attrs != null) {
            TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.FormTextEdit);
            boolean mustShow = typedArray.getBoolean(R.styleable.FormTextEdit_form_must, true);
            tv_must.setVisibility(mustShow ? VISIBLE : GONE);
            typedArray.recycle();
        }
    }
}
